import {sytRequest} from "@/request";
export  const getHospitalSet = function (page:number,limit:number,params:any={}){
    // GET /admin/hosp/hospitalSet/{page}/{limit}
    return sytRequest.get(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params
    })
}

// GET /admin/hosp/hospitalSet/lock/{id}/{status}
export const getHospitalSetLockId = function (id:number,status:number){
     status = status === 0 ? 1 : 0;
    return sytRequest.get(`/admin/hosp/hospitalSet/lock/${id}/${status}`)
}

// POST /admin/hosp/hospitalSet/save
// 新增医院设置
export  const postHospitalSetSave = function (body:any){
    return sytRequest.post("/admin/hosp/hospitalSet/save",body)
}

// 修改医院设置
// PUT /admin/hosp/hospitalSet/update
export const putHospitalSet = (body:any)=>{
    return sytRequest.put(`/admin/hosp/hospitalSet/update`,body)
}

//删除医院设置
// DELETE /admin/hosp/hospitalSet/remove/{id}
// 删除医院设置
export const deleteHospitalRemove = (id:any)=>{
    return sytRequest.delete(`/admin/hosp/hospitalSet/remove/${id}`)
}
// DELETE /admin/hosp/hospitalSet/batchRemove
// 根据id列表删除医院设置
export const deleteHospitalSetBatchRemove = (data:React.Key[])=>{
    return sytRequest.delete(`/admin/hosp/hospitalSet/batchRemove`,{
        data
    })
}

///admin/hosp/hospital/{page}/{limit}
// 获取医院分页列表
export const getHospitalList = (page:number,limit:number,params:any={})=>{
    return sytRequest.get(`admin/hosp/hospital/${page}/${limit}`,{
        params
    })
}

// GET /admin/hosp/hospital/updateStatus/{id}/{status}
// 更新上线状态
//获取数据上线状态
export const getHospitalStatus = (id:string,status:number)=>{
    status = status === 1 ? 0 : 1;
    return sytRequest.get(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}


//GET /admin/hosp/hospital/show/{id}
// 获取医院详情
export const getHospitalShow = function (id:string){
    return sytRequest.get(`/admin/hosp/hospital/show/${id}`)
}


//GET /admin/hosp/department/{hoscode}
// 获取排班分页列表
export const getHospitalDepartment = function (hoscode:any){
    return sytRequest.get(`/admin/hosp/department/${hoscode}`)
}

// GET /admin/hosp/schedule/getScheduleRule/{page}/{limit}/{hoscode}/{depcode}
// 获取排班规则数据
export const getHospitalScheduleRule = function (page:number,limit:number,hoscode:string,depcode:string){
    return sytRequest.get(`/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}